<?php


namespace app\common\system\model;


use think\Model;

class UserConfig extends Model
{
    protected $table = "tk_system_user_config";

    protected $type = [
        'company' => 'json',
        'source' => 'json',
        'store' => 'json',
    ];

    public function getCompanyAttr($value)
    {
        return empty($value) ? [] : json_decode($value, true);
    }

    public function getSourceAttr($value)
    {
        return empty($value) ? [] : json_decode($value, true);
    }

    public function getStoreAttr($value)
    {
        return empty($value) ? [] : json_decode($value, true);
    }
}